#!/bin/bash

#### Run this script before committing ####


OLDVERSION=$(head -n 1 VERSION | sed -e "s/\$Version: \([0-9]*\) \(.*\)/\1/g")
NOW=$(date +"%d %b %Y %T")
NOWUNIX=$(date +"%s")
VERSION=$((OLDVERSION+1))

sed -i -e "s/\$Version:[^\$]*/\$Version: ${VERSION} /g" VERSION
sed -i -e "s/\$Time:[^\$]*/\$Time: ${NOW} /g" VERSION
sed -i -e "s/\$Unixtime:[^\$]*/\$Unixtime: ${NOWUNIX} /g" VERSION

sed -i -e "s/\$Version:[^\$]*/\$Version: ${VERSION} /g" oscam-emu.patch

